home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
datamgr
/
dbform.frm
< prev
next >
Wrap
Text File
|
1995-10-23
|
5KB
|
186 lines
VERSION 2.00
Begin Form dbForm
BackColor = &H00C0C0C0&
Caption = "dbForm"
ClientHeight = 4470
ClientLeft = 2925
ClientTop = 3075
ClientWidth = 4275
Height = 4875
Icon = DBFORM.FRX:0000
Left = 2865
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 4470
ScaleWidth = 4275
Top = 2730
Visible = 0 'False
Width = 4395
Begin CommandButton Command4
Caption = "&Design"
Default = -1 'True
Height = 375
Left = 2220
TabIndex = 3
Top = 480
Width = 915
End
Begin CommandButton Command2
Caption = "De&lete"
Height = 375
Left = 3120
TabIndex = 4
Top = 480
Width = 915
End
Begin ListBox List1
Height = 3150
Left = 420
TabIndex = 1
Top = 840
Width = 3615
End
Begin CommandButton Command3
Caption = "&Open"
Height = 375
Left = 1320
TabIndex = 5
Top = 480
Width = 915
End
Begin CommandButton Command1
Caption = "&New"
Height = 375
Left = 420
TabIndex = 2
Top = 480
Width = 915
End
Begin Label Label1
BackStyle = 0 'Transparent
Caption = "&Tables:"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 435
Left = 120
TabIndex = 0
Top = 120
Width = 2415
End
End
Option Explicit
Sub Command1_Click ()
OpenNewTableDesign
End Sub
Sub Command2_Click ()
Dim x As Integer
On Error Resume Next
If list1.ListIndex = -1 Then
MsgBox "No Table Selected: You must select a table before it can be deleted", 64, "Data Manager"
Else
x = MsgBox("Are You Sure You Want To Delete Table: """ + list1.List(list1.ListIndex) + """?", 33, "Data Manager")
If x = 1 Then
gDatabase.TableDefs.Delete list1.List(list1.ListIndex)
If Err <> 0 Then
MsgBox "Could Not Delete Table:" + Chr$(13) + Error$, 64, "Data Manager"
Exit Sub
Else
RefreshDatabaseWindow
End If
End If
End If
End Sub
Sub Command3_Click ()
On Error Resume Next 'catch case where form doesn't load
If list1.ListIndex <> -1 Then
MainForm.TableName = list1.List(list1.ListIndex)
Dim x As New DataForm
x.Show
If Err Then Exit Sub
Else
MsgBox "No Table Selected", 64, "Data Manager"
End If
End Sub
Sub command4_click ()
If list1.ListIndex <> -1 Then
If Not OpenTableDesign((list1.List(list1.ListIndex))) Then
MsgBox "Could Not Open Table Design Window.", 64, "Data Manager"
End If
Else
MsgBox "No Table Selected", 64, "Data Manager"
End If
End Sub
Sub Form_Load ()
Me.Tag = "Database"
Left = 0
Top = 0
End Sub
Sub Form_Resize ()
On Error Resume Next
Dim i As Integer
If Me.WindowState = 0 Then
If Me.Width < 2000 Then
Me.Width = 2000
End If
If Me.Height < 2070 Then
Me.Height = 2070
End If
End If
If Me.WindowState <> 1 Then
list1.Width = Me.ScaleWidth - 120 - list1.Left
list1.Height = Me.ScaleHeight - 120 - list1.Top
End If
End Sub
Sub Form_Unload (Cancel As Integer)
Dim max As Integer
Dim i As Integer
Dim abort As Integer
Dim temp As Integer
gDatabase.Close
gDatabaseName = ""
max = forms.Count - 1
i = 0
abort = False
Do While i <= max
If forms(i).Tag <> "Main" And forms(i).Tag <> "Database" Then
temp = forms.Count
Unload forms(i)
If temp = forms.Count Then
abort = True
Exit Do
End If
max = max - 1
Else
i = i + 1
End If
Loop
End Sub
Sub List1_DblClick ()
command4_click
End Sub